package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.station.dto.AddStationDto;
import com.shensi.api.admin.domian.station.dto.AddStationSettleInfoDto;
import com.shensi.api.admin.domian.station.dto.StationDto;
import com.shensi.api.admin.domian.station.dto.SyncUserDto;
import com.shensi.api.admin.domian.station.vo.StationVo;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface StationClient {
    /**
     * 查询油站信息列表
     */
    @GetMapping("/station/message/listEnterpriseStation")
    @ApiOperation(value = "获取油站信息列表", notes = "获取油站信息列表")
    public List<StationVo> listEnterpriseStation(@SpringQueryMap StationDto station);

    /**
     * 查询油站信息列表
     */
    @GetMapping("/station/message/list")
    public TableDataInfo list(@SpringQueryMap StationDto station);

    //添加油站清分信息
    @PostMapping("/station/message/addOrUpdateSettleInfo")
    public AjaxResult addOrUpdateSettleInfo(@RequestBody @Valid AddStationSettleInfoDto addStationSettleInfoDto);

    @GetMapping("/station/message/getStationSettleInfo")
    public AjaxResult getStationSettleInfo(@RequestParam("stationId") @NotEmpty String stationId);

    @GetMapping("/station/message/setShowCommisson")
    public AjaxResult setShowCommisson(@SpringQueryMap StationDto station);

    /**
     * 查询油站信息列表
     */
    @GetMapping("/station/message/getStationDifferent")
    public TableDataInfo getStationDifferent(@SpringQueryMap StationDto station);

    /**
     * 新增油站
     */
    @PostMapping("/station/message/batchInsertStations")
    public AjaxResult addStations(@RequestBody List<StationDto> stationList) throws Exception;

    /**
     * 新增油站或者油企
     */
    @PostMapping("/station/message/addStationOrEnterprise")
    public AjaxResult addStationOrEnterprise(@RequestBody @Valid AddStationDto addStationDto) throws Exception ;

    /**
     * 新增油站
     */
    @PostMapping("/station/message")
    public AjaxResult add(@RequestBody StationDto station);

    /**
     * 新增油企
     */
    @PostMapping("/station/message/addPayWay")
    public AjaxResult addPayWay(@RequestBody StationDto station);


    /**
     * 逻辑删除
     */
    @PostMapping(value = "/station/message/deleteStation")
    public AjaxResult deleteStation(@RequestBody StationDto station);


    /**
     * 获取油站信息详细信息
     */
    @GetMapping(value = "/{stationId}")
    public AjaxResult getInfo(@PathVariable("stationId") Long stationId);
    /**
     * 修改油站信息
     */
    @PutMapping("")
    public AjaxResult edit(@RequestBody StationDto station) ;

    @GetMapping("/getStationInfo")
    public AjaxResult getStationInfo();
}
